package com.cmit.upay.monitor.vo;

import lombok.Builder;
import lombok.Data;

/**
 * 队列对应的模型
 */
@Builder
@Data
public class QueueVO {
    /** 监控时间 */
    private String monitorTime;
    /** 队列名 */
    private String name;
    /** 队列中消息数量，未被消费 */
    private long queueSize;
    /** 生产者数量 */
    private long producerCount;
    /** 消费者数量 */
    private long consumerCount;
    /** 已接收消息 */
    private long enqueueCount;
    /** 已消费消息 */
    private long dequeueCount;

    public void setQueueSize(long queueSize) {
        this.queueSize = queueSize;
    }

    @Override
    public String toString() {
        return monitorTime +
                " 队列名=" + name +
                ", 未消费消息=" + queueSize +
                ", 生产者数量=" + producerCount +
                ", 消费者数量=" + consumerCount +
                ", 已接收消息数量=" + enqueueCount +
                ", 已消费消息数量=" + dequeueCount;
    }
}
